package com.github.live.util;

import com.github.livebase.log.FileLogger;
import com.github.livebase.log.Formatter;
import com.github.livebase.log.LoggerDefinition;
import com.github.livebase.log.LoggerException;
import com.github.livebase.log.LoggerFactory;
import java.io.File;

/**
 * @ClassName ILogger
 * @description:
 * @author: biao532
 * @create: 2024-02-03 22:50
 * @Version 1.0
 **/
public class ILogger extends FileLogger {
    public static void registerILogger(String packageName, int level, File logFile) throws LoggerException {
        LoggerDefinition definition = new LoggerDefinition(ILogger.class.getName(), packageName);
        definition.addParameter("level", level, int.class);
        definition.addParameter("file", logFile, File.class);
        LoggerFactory.registerLogger(definition);
    }
    public ILogger() {
        super("", 0);
    }

    public ILogger(Formatter formatter) {
        super(formatter, "", LEVEL_DEBUG);
    }

    @Override
    public void setLevel(int level) {
        super.setLevel(level);
    }

    public void setFile(File file) {
        super.setFile(file.getAbsolutePath());
    }
}
